package com.leyou.web;

import com.leyou.dto.OrderFormDTO;
import com.leyou.entity.Order;
import com.leyou.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("order")
public class orderController {


    @Autowired
    private OrderService orderService;

    /**
     * 下单
     * @param
     * @return
     */
    @PostMapping
    public ResponseEntity<Long> createOrder(@RequestBody OrderFormDTO orderFormDTO) {

        return ResponseEntity.ok().body(this.orderService.createOrder(orderFormDTO));
    }
}
